<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.List" import="java.util.ArrayList" import="org.tobuy.vo.*"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   
    
    <title>My JSP 'showAuction.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  <h3>Currently running Auctions</h3>
    	<table border=1>
   			<tr>
   				<td>Seller</td>
   				<td>Type</td>
  				<td>Name</td>
  				<td>Direct Price</td>
  				<td>Description</td>
  				<td>Current price</td>
  				<td>Price offer User</td>
  				<td>Exp. time</td>
  				<td>Detail</td>
 		  </tr>
    <%
		List<Auction> auctions = new ArrayList<Auction>();
		List<Item> items = new ArrayList<Item>();
		auctions = (ArrayList<Auction>) request.getAttribute("auctions");
		items = (ArrayList<Item>) request.getAttribute("items");
		Iterator<Auction> auctionIter = auctions.iterator();
		Iterator<Item> itemIter = items.iterator();
		while(auctionIter.hasNext()){
			Auction auction = auctionIter.next();
			Item item = itemIter.next();
	%>
		<tr>
			<td><%=auction.getSeller_id() %></td>
			<td><%=item.getType() %></td>
			<td><%=item.getItem_name() %></td>
			<td><%=item.getPrice() %></td>
			<td><%=item.getBeschreibung() %></td>
			<td><%=auction.getBuyer_offer() %></td>
			<td><%=auction.getBuyer_id() %></td>
			<td><%=auction.getExp_time() %></td>
			<td><a href="ShowAuctionDetail?item_id=<%=item.getItem_id() %>">Show detail</a></td>
		
		</tr>
	<%
		
		}
	 %>
  </body>
</html>
